import Vue from 'vue'
import Router from 'vue-router'

import Login from '../components/Login.vue'
import Home from '../components/Home.vue'


import AgentCashOutForm from '../components/agent/AgentCashOutForm.vue'

import AgentTable from '../components/agent/AgentTable.vue'
import AgentChildrenTable from '../components/agent/AgentChildrenTable.vue'
import AgentBankEdit from '../components/agent/AgentBankEdit.vue'

import AgentCashTable from '../components/agent/AgentCashTable.vue'
import AgentCashAudit from '../components/agent/AgentCashAudit.vue'

import AgentServiceFeeList from '../components/agent/AgentServiceFeeList.vue'
import AgentInterestList from '../components/agent/AgentInterestList.vue'

import PromoteQR from '../components/agent/PromoteQR.vue'
import FormAgentCreate from '../components/agent/FormAgentCreate.vue'
import FormAgentUpdate from '../components/agent/FormAgentUpdate.vue'
import EmployeeList from '../components/employee/EmployeeList.vue'
import SystemUserList from '../components/employee/SystemUserList.vue'

import EmployeeCreate from '../components/employee/FormEmployeeCreate.vue'
import EmployeeUpdate from '../components/employee/FormEmployeeUpdate.vue'
import ClientList from '../components/client/ClientList.vue'
import ClientEditForm from '../components/client/ClientEditForm.vue'
import ClientSwapForm from '../components/client/ClientSwapForm.vue'

import ClientBankList from '../components/client/ClientBankList.vue'
import ClientBankEdit from '../components/client/ClientBankEdit.vue'


import UStockFinacingHoldingList from '../components/trade/uStockFinancingHolding/UStockFinancingHoldingList.vue';

import ClientWithdrawList from '../components/client/ClientWithdrawList.vue'
import ClientWithdrawEdit from '../components/client/ClientWithdrawEdit.vue'

import ClientRechargeList from '../components/client/ClientRechargeList.vue'
import ClientRechargeAudit from '../components/client/ClientRechargeAudit.vue'

import ClientAccountAdjust from '../components/client/ClientAccountAdjust.vue'

import MessageList from '../components/client/MessageList.vue'


import SystemParams from '../components/system/params/SystemParams.vue'

import TransRistControlRules from '../components/system/riskRuler/TransRistControlRules.vue'

import HolidayMaintains from '../components/system/holidayMaintain/HolidayMaintains.vue'
import HolidayMaintainCreate from '../components/system/holidayMaintain/HolidayMaintainCreate.vue'
import HolidayMaintainEdit from '../components/system/holidayMaintain/HolidayMaintainEdit.vue'


import StockFinanceProducts from '../components/system/financeProduct/StockFinanceProducts.vue'
import StockFinanceProductEdit from '../components/system/financeProduct/StockFinanceProductEdit.vue'

import StockInfos from '../components/system/info/StockInfos.vue'
import StockInfoEdit from '../components/system/info/StockInfoEdit.vue'

import StockFees from '../components/system/fee/StockFees.vue'

import XrDrInfos from '../components/stock/xrDrInfo/XrDrInfos.vue'

import ParentStockFinances from '../components/stock/parentFinance/ParentStockFinances.vue'
import ParentStockFinanceCreate from '../components/stock/parentFinance/ParentStockFinanceCreate.vue'
import ParentStockFinanceEdit from '../components/stock/parentFinance/ParentStockFinanceEdit.vue'

import UStockFinancings from '../components/stock/uStockFinancing/UStockFinancings.vue'
import UStockFinancingsID from '../components/stock/uStockFinancing/UStockFinancingsID.vue'
import UStockFinancingEdit from '../components/stock/uStockFinancing/UStockFinancingEdit.vue'
import UStockFinancingRiskEdit from '../components/stock/uStockFinancing/UStockFinancingEdit.vue'
import UStockFinancingLogs from '../components/stock/uStockFinancingLog/UStockFinancingLogs.vue'

import UStockFinancingRisks from '../components/stock/uStockFinancingRisk/UStockFinancingRisks.vue'

import UStockFinanceInterestPercentages from '../components/stock/uStockFinanceInterestPercentage/UStockFinanceInterestPercentages.vue'

import CapitalPools from '../components/stock/capitalPool/CapitalPools.vue'
import CapitalPoolCreate from '../components/stock/capitalPool/CapitalPoolCreate.vue'
import CapitalPoolEdit from '../components/stock/capitalPool/CapitalPoolEdit.vue'

import StockFinanceRiskLogs from '../components/trade/stockFinanceRiskLog/StockFinanceRiskLogs.vue'
import UStockFinanceDayMakedeals from '../components/trade/uStockFinanceDayMakedeal/UStockFinanceDayMakedeals.vue'
import UParentStockFinanceEntrustsBuy from '../components/trade/uParentStockFinanceDayMakedeal/UParentStockFinanceEntrustsBuy.vue'
import UParentStockFinanceEntrustsSell from '../components/trade/uParentStockFinanceDayMakedeal/UParentStockFinanceEntrustsSell.vue'
import UStockFinanceDayMakedealHistorys from '../components/trade/uStockFinanceDayMakedealHistory/UStockFinanceDayMakedealHistorys.vue'
import UStockFinanceEntrusts from '../components/trade/uStockFinanceEntrust/UStockFinanceEntrusts.vue'
import UStockFinanceEntrustHistorys from '../components/trade/uStockFinanceEntrustHistory/UStockFinanceEntrustHistorys.vue'
import UStockFinancingFlows from '../components/trade/uStockFinancingFlow/UStockFinancingFlows.vue'
import UStockFinanceMakedealFees from '../components/trade/uStockFinanceDayMakedeal/UStockFinanceMakedealFees.vue'

import AgentDayAchievementReports from '../components/report/AgentDayAchievementReports.vue'
import AgentMaxPerformanceReports from '../components/report/AgentMaxPerformanceReports.vue'


import ClientMoneyList from '../components/client/ClientMoneyList.vue'

import NotFound from '../components/404.vue'

import EmployeeFullReport from '../components/report/EmployeeFullReport.vue'
import EmployeeDayReport from '../components/report/EmployeeDayReport.vue'
import EmployeeTotalReport from '../components/report/EmployeeTotalReport.vue'

import ClientDayReport from '../components/report/ClientDayReport.vue'
import ClientFullReport from '../components/report/ClientFullReport.vue'

import Articles from '../components/content/Articles.vue'
import ArticleEdit from '../components/content/ArticleEdit.vue'
import Helps from '../components/content/Helps.vue'
import HelpEdit from '../components/content/HelpEdit.vue'
import HelpTypes from '../components/content/HelpTypes.vue'
import HelpTypeEdit from '../components/content/HelpTypeEdit.vue'
import Protocols from '../components/content/Protocols.vue'
import ProtocolEdit from '../components/content/ProtocolEdit.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  linkActiveClass: 'select_leaf',
  linkExactActiveClass: 'select_leaf',
  routes: [
    {
      path: '/',
      component: Home,
      name: '代理管理',
      children: [
        {
          path: '/agent/applyCashOut',
          component: AgentCashOutForm,
          name: '代理商提现申请',
        },
        {
          path: '/agent',
          component: AgentTable,
          name: '代理列表',
        },
        {
          path: '/agent/children',
          component: AgentChildrenTable,
          name: '下级代理列表',
        },
        {
          path: '/agent/serviceFee',
          component: AgentServiceFeeList,
          name: '代理商服务费明细',
        },
        {
          path: '/agent/interestList',
          component: AgentInterestList,
          name: '代理商利息分成明细',
        },

        {
          path: '/agent/cash',
          component: AgentCashTable,
          name: '代理提现',
        },
        {
          path: '/agent/cashBankEdit',
          component: AgentBankEdit,
          name: '代理提现银行卡',
        },
        {
          path: '/agent/cash/audit/:id',
          component: AgentCashAudit,
          name: '代理提现审核',
        },
        {
          path: 'agent/create',
          component: FormAgentCreate,
          name: '代理商创建',
        },
        {
          path: 'agent/update/:id',
          component: FormAgentUpdate,
          name: '代理商修改',
        },
        {
          path: 'agent/recommend/code',
          component: PromoteQR,
          name: '推广二维码',
        }
      ]
    },
    {
      path: '/employee',
      component: Home,
      name: '员工管理',
      children: [
        {
          path: '/employee',
          component: EmployeeList,
          name: '员工列表',
        },
        {
          path: 'create',
          component: EmployeeCreate,
          name: '员工创建',
        },
        {
          path: 'update/:id',
          component: EmployeeUpdate,
          name: '员工修改',
        }
      ]
    },
    {
      path: '/client',
      component: Home,
      name: '客户管理',
      children: [
        {
          path: '/client',
          component: ClientList,
          name: '客户列表',
        },
        {
          path: 'account',
          component: ClientMoneyList,
          name: '客户资金',
        },

        {
          path: 'swap/:id',
          name: '客户变更归属',
          component: ClientSwapForm,

        },
        {
          path: 'edit/:id',
          component: ClientEditForm,

          name: '客户修改'
        },
        {
          path: 'adjust/:id',
          component: ClientAccountAdjust,
          name: '调整客户余额'
        },
        {
          path: 'bankCard',
          component: ClientBankList,
          name: '客户银行卡',
        },
        {
          path: 'bankCard/edit/:id',
          component: ClientBankEdit,
          name: '客户银行卡编辑',
        },
        {
          path: 'withdraw',
          component: ClientWithdrawList,
          name: '客户提现',
        },
        {
          path: 'withdraw/audit/:id',
          component: ClientWithdrawEdit,
          name: '客户提现审核',
        },
        {
          path: 'recharge',
          component: ClientRechargeList,
          name: '客户充值',
        },
        {
          path: 'recharge/audit/:id',
          component: ClientRechargeAudit,
          name: '客户充值审核',
        },
        {
          path: 'message',
          component: MessageList,
          name: '短信查询',
        },

      ]
    },
    {
      path: '/system',
      component: Home,
      name: '系统管理',
      children: [
        {path: '/system', component: SystemParams, name: '平台配置'},
        {path: '/system/holidayMaintains', component: HolidayMaintains, name: '节假日管理'},
        {path: '/system/holidayMaintain/create', component: HolidayMaintainCreate, name: '新增节假日'},
        {path: '/system/holidayMaintain/edit/:id', component: HolidayMaintainEdit, name: '修改节假日',},
        {path: '/system/financeProducts', component: StockFinanceProducts, name: '股票配资产品管理'},
        {path: '/system/financeProduct/edit/:id', component: StockFinanceProductEdit, name: '修改股票配资产品'},
        {path: '/system/infos', component: StockInfos, name: '股票管理'},
        {path: '/system/info/edit/:id', component: StockInfoEdit, name: '编辑股票'},
        {path: '/system/fees', component: StockFees, name: '收费管理标准'},
        {path: '/system/transRistControlRules', component: TransRistControlRules, name: '风控规则'},
        {path: '/system/user', component: SystemUserList, name: '后台用户'},

      ]
    },
    {
      path: '/stock',
      component: Home,
      name: '配资管理',
      children: [
        {path: '/stock/uStockFinancings', component: UStockFinancings, name: '操盘账户'},
        {path: '/stock/uStockFinancings/:id', component: UStockFinancingsID, name: '子账户'},
        {path: '/stock/uStockFinancing/edit/:id', component: UStockFinancingEdit, name: '修改操盘账户'},
        {path: '/stock/uStockFinancingRisks', component: UStockFinancingRisks, name: '风控管理'},
        {path: '/stock/uStockFinancingRisk/edit/:id', component: UStockFinancingRiskEdit, name: '修改风控管理'},
        {path: '/stock/uStockFinancingLogs', component: UStockFinancingLogs, name: '配资记录'},
        {path: '/stock/uStockFinanceInterestPercentages', component: UStockFinanceInterestPercentages, name: '配资付息'},
        {path: '/stock/parentStockFinances', component: ParentStockFinances, name: '操盘母账户管理'},
        {path: '/stock/parentStockFinance/create', component: ParentStockFinanceCreate, name: '新增母账户'},
        {path: '/stock/parentStockFinance/edit/:id', component: ParentStockFinanceEdit, name: '修改母账户'},
        {path: '/stock/capitalPools', component: CapitalPools, name: '资金池管理'},
        {path: '/stock/capitalPool/create', component: CapitalPoolCreate, name: '新增资金池'},
        {path: '/stock/capitalPool/edit/:id', component: CapitalPoolEdit, name: '修改资金池'},
        {path: '/stock/xrDrInfos', component: XrDrInfos, name: '除权降息管理'}
      ]
    },
    {
      path: '/trade',
      component: Home,
      name: '交易查询',
      children: [
        {path: '/trade/stockFinanceRiskLogs', component: StockFinanceRiskLogs, name: '风控日志'},
        {path: '/trade/uStockFinanceDayMakedeals', component: UStockFinanceDayMakedeals, name: '当日成交'},
        {path: '/trade/uStockFinanceDayMakedealHistorys', component: UStockFinanceDayMakedealHistorys, name: '历史成交'},
        {path: '/trade/uStockFinanceEntrusts', component: UStockFinanceEntrusts, name: '当日委托'},
        {path: '/trade/uStockFinanceEntrustHistorys', component: UStockFinanceEntrustHistorys, name: '历史委托'},
        {path: '/trade/uStockFinancingFlows', component: UStockFinancingFlows, name: '资金流水'},
        {path: '/trade/uStockFinacingHoldingList', component: UStockFinacingHoldingList, name: '持仓股份'},
        {path: '/trade/uStockFinacingHoldingList/sfid/:sfid', component: UStockFinacingHoldingList, name: '子账户持仓股份'},
        {path: '/trade/uParentStockFinanceEntrustsSell', component: UParentStockFinanceEntrustsSell, name: '母账号卖出手动分配'},
        {path: '/trade/uParentStockFinanceEntrustsBuy', component: UParentStockFinanceEntrustsBuy, name: '母账号买入手动分配'},
        {path: '/trade/uStockFinanceMakedealFees', component: UStockFinanceMakedealFees, name: '佣金统计'}
      ]
    },
    {
      path: '/login',
      component: Login,
      name: '管理后台登陆',
    },
    {
      path: '/404',
      component: NotFound,
      name: '',
    },
    {
      path: '/cms',
      component: Home,
      name: '内容管理',
      children: []
    },

    {
      path: '/report',
      component: Home,
      name: '查询统计',
      children: [
        {
          path: 'employeeFull',
          component: EmployeeFullReport,
          name: '员工总报表',
        },
        {
          path: 'employeeDay',
          component: EmployeeDayReport,
          name: '员工天报表',
        },
        {
          path: 'employeeTotal',
          component: EmployeeTotalReport,
          name: '员工业绩总报表',
        },
        {
          path: 'clientDay',
          component: ClientDayReport,
          name: '业绩日报表',
        },
        {
          path: 'clientFull',
          component: ClientFullReport,
          name: '业绩累计报表',
        },
        {
              path: '/report/agentDayAchievementReports',
              component: AgentDayAchievementReports,
              name: '代理商日报表'
          },
          {
              path: '/report/agentMaxPerformanceReports',
              component: AgentMaxPerformanceReports,
              name: '代理商峰值表'
        }
      ]

    },
      {
          path: '/content',
          component: Home,
          name: '内容管理',
          children: [
              {path: '/content/articles', component: Articles, name: '文章管理'},
              {path: '/content/articleEdit', component: ArticleEdit, name: '新增文章'},
              {path: '/content/articleEdit/:id', component: ArticleEdit, name: '修改文章'},
              {path: '/content/helps', component: Helps, name: '帮助中心'},
              {path: '/content/helpEdit', component: HelpEdit, name: '新增帮助'},
              {path: '/content/helpEdit/:id', component: HelpEdit, name: '修改帮助'},
              {path: '/content/helpTypes', component: HelpTypes, name: '帮助中心分类'},
              {path: '/content/helpTypeEdit', component: HelpTypeEdit, name: '新增帮助分类'},
              {path: '/content/helpTypeEdit/:id', component: HelpTypeEdit, name: '修改帮助分类'},
              {path: '/content/protocols', component: Protocols, name: '协议管理'},
              {path: '/content/protocolEdit', component: ProtocolEdit, name: '新增协议'},
              {path: '/content/protocolEdit/:id', component: ProtocolEdit, name: '修改协议'},
          ]

      },
    {
      path: '*',
      redirect: {path: '/404'}
    }
  ]
})
